Skip to content

contribution-check: offload report formatting and comment routing to small-model sub-agents#33655

Merged
pelikhan merged 3 commits into
mainfrom
copilot/subagent-optimizer-optimize-contribution-check
May 21, 2026
Merged

contribution-check: offload report formatting and comment routing to small-model sub-agents#33655
pelikhan merged 3 commits into
mainfrom
copilot/subagent-optimizer-optimize-contribution-check

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

The contribution-check orchestrator carried ~70 lines of static report layout rules + a full example report in its context every run, plus ~14 lines of comment routing logic — all templated work well-suited to a cheaper model.

Changes

  • Removed ### Report Layout Rules and ### Example Report subsections (~70 lines) from ## Step 2: Compile Report; replaced with a one-line report-formatter agent invocation that passes the verdict array, skipped_count, and an explicit run_url (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
  • Replaced the 14-line ### Posting comments block (with examples/caveats) with a one-line comment-dispatcher agent invocation; clarified that the input is the JSON objects returned by the contribution-checker subagent in Step 1
  • Added two inline ## agent: blocks at the bottom of the file (after {{#runtime-import shared/noop-reminder.md}}):
## agent: `report-formatter`
---
model: small
---
# groups verdict array → Ready/Needs-look/Off-guidelines markdown tables

## agent: `comment-dispatcher`
---
model: small
---
# filters verdict array → [{issue_number, body}] for non-lgtm, non-empty-comment entries

Both sub-agents use model: small. They are orthogonal to the existing file-based contribution-checker delegate and can run concurrently once subagent results land. Compiled clean with gh aw compile --strict (0 errors, 0 warnings).

Copilot AI and others added 2 commits May 21, 2026 00:34
…her sub-agents

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ay reference

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize contribution-check workflow for performance contribution-check: offload report formatting and comment routing to small-model sub-agents May 21, 2026
Copilot AI requested a review from pelikhan May 21, 2026 00:38
@pelikhan pelikhan marked this pull request as ready for review May 21, 2026 00:43
Copilot AI review requested due to automatic review settings May 21, 2026 00:43
@pelikhan pelikhan merged commit b8ccd52 into main May 21, 2026
@pelikhan pelikhan deleted the copilot/subagent-optimizer-optimize-contribution-check branch May 21, 2026 00:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the Contribution Check orchestrator prompt to offload report formatting and PR comment payload routing into two inline model: small sub-agents, reducing prompt bloat and templated logic in the main orchestrator.

Changes:

  • Replaced the inline “Posting comments” logic with a comment-dispatcher sub-agent invocation that returns [{issue_number, body}].
  • Replaced the large static report layout rules/example with a report-formatter sub-agent invocation that generates the report issue markdown body.
  • Regenerated the compiled workflow lock file (compiler v0.74.8), including updated setup action wiring and environment propagation for github.server_url/github.run_id.
Show a summary per file
File Description
.github/workflows/contribution-check.md Moves report formatting and comment routing into two inline small-model agents and updates Step 1/2 instructions to call them.
.github/workflows/contribution-check.lock.yml Regenerated compiled workflow/lock output reflecting the updated prompt and compiler/runtime wiring.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 4

Comment on lines +230 to +231
You receive a JSON array of PR verdict objects (each with fields: `number`, `title`, `author`, `lines`, `quality`, `comment`) plus a `skipped_count` integer and a `run_url` string.

Comment on lines +234 to +235
1. **Lead with the takeaway.** Open with a single-sentence human-readable summary: *"We looked at {evaluated} new PRs — {n} look great, {n} need a closer look, and {n} don't fit the project guidelines."*

- **Ready to review** 🟢 — PRs where `quality == "lgtm"`
- **Needs a closer look** 🟡 — PRs where `quality == "needs-work"`
- **Off-guidelines** 🔴 — PRs where `quality == "spam"` or `quality == "outdated"`
- **Triage needed** ❓ — PRs where `quality` starts with `"triage"` or is unknown
- **Off-guidelines** 🔴 — PRs where `quality == "spam"` or `quality == "outdated"`
- **Triage needed** ❓ — PRs where `quality` starts with `"triage"` or is unknown

3. **One table per group.** Columns: PR (linked as `#number`), Title (truncated to ~50 chars), Author (with `@`), Lines changed, Quality signal. Do NOT include boolean checklist columns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[subagent-optimizer] Optimize contribution-check — 2026-05-20

3 participants